<?php
/*
 * @Author       : ZengHao
 * @Date         : 2024-03-19 15:28:28
 * @LastEditors  : ZengHao
 * @LastEditTime : 2024-03-21 11:07:38
 * @FilePath     : \options\admin-options.php
 * @Description  : 
 * Copyright 2024 www.exehub.net, All Rights Reserved. 
 * 2024-03-19 15:28:28
 */

 $prefix = 'msgboot_fix';

function msgbot_csf_admin_options()
{
    // 限制只有后台才能执行主题初始化代码
    if (!is_admin()) {
        return;
    }
    $prefix = 'msgboot_fix';
    //开始构建
    CSF::createOptions(
        $prefix,
        array(
            'menu_title' => '消息推送机器人',
            'menu_slug' => 'msgbot_options',
            'menu_icon' => 'dashicons-twitch',
            'framework_title' => '消息推送机器人',
            'show_in_customizer' => true,
            'footer_text' => '<a href="" target="_blank">消息推送机器人</a> 不错过每一条消息',
            'footer_credit' => '<i class="fa fa-fw fa-bell-o" aria-hidden="true"></i> 感谢您使用强大的 <a href="https://wordpress.org">WordPress</a> 搭配 <a href="" target="_blank">MsgBot消息推送机器人</a> 使用',
            'theme' => 'light',
        )
    );

    CSF::createSection(
        $prefix,
        array(
            'id' => 'basic',
            'title' => '推送设置',
            'icon' => 'fa fa-cogs',
        )
    );

    CSF::createSection(
        $prefix,
        array(
            'title' => '插件备份',
            'icon' => 'fa fa-server',
            'fields'      => array(
                array(
                    'type' => 'backup',
                ),
            ),
        )
    );

    //载入分类设置文件，方便管理
    $cfs_options = array(
        'cfs-bark',
        'cfs-coolpush',
        'cfs-dingtalk',
        'cfs-email',
        'cfs-fangtang',
        'cfs-feishu',
        'cfs-mwechat',
        'cfs-pushbear',
        'cfs-qmsg',
        'cfs-telegram',
        'cfs-wechat',
    );


    foreach ($cfs_options as $cfs) {
        $path = 'options/cfs-options/' . $cfs . '.php';
        include MSGBOT_PLUGIN_DIR . $path;
    }
}
msgbot_csf_admin_options();